package com.yipei.business.service;

import java.io.IOException;
import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

import com.baomidou.mybatisplus.extension.service.IService;
import com.yipei.business.domain.MlPositionShare;
import com.yipei.business.domain.MlTradeEntrustOrder;
import com.yipei.business.vo.BuySellVo;
import com.yipei.business.vo.PositionShareVo;
import com.yipei.common.core.domain.entity.MlTradeAccount;

/**
 * 持仓股票Service接口
 *
 * @author yipei
 * @date 2024-12-21
 */
public interface IMlPositionShareService extends IService<MlPositionShare>
{
    /**
     * 查询持仓股票
     *
     * @param id 持仓股票主键
     * @return 持仓股票
     */
    public MlPositionShare selectMlPositionShareById(Long id);

    /**
     * 查询持仓股票列表
     *
     * @param mlPositionShare 持仓股票
     * @return 持仓股票集合
     */
    public List<MlPositionShare> selectMlPositionShareList(MlPositionShare mlPositionShare);

    /**
     * 新增持仓股票
     *
     * @param mlPositionShare 持仓股票
     * @return 结果
     */
    public int insertMlPositionShare(MlPositionShare mlPositionShare);

    /**
     * 修改持仓股票
     *
     * @param mlPositionShare 持仓股票
     * @return 结果
     */
    public int updateMlPositionShare(MlPositionShare mlPositionShare);

    /**
     * 批量删除持仓股票
     *
     * @param ids 需要删除的持仓股票主键集合
     * @return 结果
     */
    public int deleteMlPositionShareByIds(Long[] ids);

    /**
     * 删除持仓股票信息
     *
     * @param id 持仓股票主键
     * @return 结果
     */
    public int deleteMlPositionShareById(Long id);

    void createpositionShareData(PositionShareVo positionShareVo, List<MlPositionShare> mlPositionShares, MlTradeAccount mlTradeAccount) throws IOException;

    BuySellVo ceratePositionShare(String f12, BigDecimal price, String id);

    Map<String, List<MlPositionShare>> getPositionMapByTdAccAndSymbol(List<MlTradeEntrustOrder> orders);
}
